﻿using System.Diagnostics;
using System.Windows.Input;
using Helper;

namespace Starehe.ViewModels
{
    public class ImportWizardVM: ViewModelBase
    {
        string tempFilePath;
        public ImportWizardVM()
        {
            CreateCommands();
            LoadExcelTemplate();
        }

        protected override void InitVars()
        {
            throw new System.NotImplementedException();
        }

        private void LoadExcelTemplate()
        {
            ExcelHelper exh = new ExcelHelper();
           // exh.LoadTemplate(DatabaseDefn.);
        }

        protected override void CreateCommands()
        {
            BroweToTempFileCommand = new RelayCommand(o =>
            {
                try
                {
                    Process.Start("explorer.exe", @"/select, """ + TempFilePath + @"""");
                }
                catch { }
            }, o =>
            {
                return !string.IsNullOrWhiteSpace(TempFilePath);
            });

            LoadDataCommand = new RelayCommand(o =>
            {

            }, o =>
            {
                return true;
            });
        }

        public string TempFilePath
        {
            get { return this.tempFilePath; }

            set
            {
                if (value != this.tempFilePath)
                {
                    this.tempFilePath = value;
                    NotifyPropertyChanged("TempFilePath");
                }
            }
        }

        public ICommand BroweToTempFileCommand
        {
            get;
            private set;
        }

        public ICommand LoadDataCommand
        {
            get;
            private set;
        }

        public override void Reset()
        {
            throw new System.NotImplementedException();
        }
    }
}
